
unit PendulumViewUtils;

interface
  uses Math, Graphics, Windows, SysUtils;
  
  type
  TMethod = procedure of object;
  TPVEvent = procedure (Sender : TObject) of object;
  
  
  //Math appearance functions
  function deg2radRS(degrees: real) : string;
  function rad2degRS(radians: real) : string;

  function deg2rad(degrees: real) : real;
  function rad2deg(radians: real) : real;

  function deg2radR(degrees: real) : integer;
  function rad2degR(radians: real) : integer;
  
implementation

   function deg2rad(degrees: real) : real;
  begin
    deg2rad := degrees/180*pi;
  end;

  function rad2deg(radians: real) : real;
  begin
    rad2deg := radians/pi*180;
  end;

  function deg2radR(degrees: real) : integer;
  begin
    deg2radR := round(deg2rad(degrees));
  end;
  
  function rad2degR(radians: real) :integer;
  begin
    rad2degR := round(rad2deg(radians));
  end;
  function deg2radRS(degrees: real) : string;
  begin
    deg2radRS := intToStr(deg2RadR(degrees));
  end;
  
  
  function rad2degRS(radians: real) : string;
  begin
    rad2degRS := intToStr(rad2degR(radians));
  end;
  
end.
